const request = require("request");

class jenkinsApiService {
    constructor() {

    }
    AllProjectStatus(_callbackFN) {
        //jenkins 地址
        //request("http://192.168.11.219:8000/api/json?tree=jobs[name,displayName,color,url,jobs[name,color]]", {
        //服务器中jenkins地址
        request("http://172.18.0.2:8080/api/json?tree=jobs[name,displayName,color,url,jobs[name,color]]", {
            auth: {
                'user': "admin",
                "password": "admin"
            }
        }, function (error, response, body) {
            if (_callbackFN) {
                _callbackFN(body);
            }
        });
    }
}

module.exports = jenkinsApiService